package com.ruoyi.fts.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fts.mapper.FtsUserWatchMapper;
import com.ruoyi.fts.domain.FtsUserWatch;
import com.ruoyi.fts.service.IFtsUserWatchService;

/**
 * 用户观看记录Service业务层处理
 *
 * @author lumberer
 * @date 2024-10-22
 */
@Service
public class FtsUserWatchServiceImpl extends ServiceImpl<FtsUserWatchMapper, FtsUserWatch> implements IFtsUserWatchService {
    @Autowired
    private FtsUserWatchMapper ftsUserWatchMapper;

    /**
     * 查询用户观看记录
     *
     * @param id 用户观看记录主键
     * @return 用户观看记录
     */
    @Override
    public FtsUserWatch selectFtsUserWatchById(Long id) {
        return ftsUserWatchMapper.selectFtsUserWatchById(id);
    }

    /**
     * 查询用户观看记录列表
     *
     * @param ftsUserWatch 用户观看记录
     * @return 用户观看记录
     */
    @Override
    public List<FtsUserWatch> selectFtsUserWatchList(FtsUserWatch ftsUserWatch) {
        return ftsUserWatchMapper.selectFtsUserWatchList(ftsUserWatch);
    }

    /**
     * 新增用户观看记录
     *
     * @param ftsUserWatch 用户观看记录
     * @return 结果
     */
    @Override
    public int insertFtsUserWatch(FtsUserWatch ftsUserWatch) {
                ftsUserWatch.setCreateTime(DateUtils.getNowDate());
            return ftsUserWatchMapper.insert(ftsUserWatch);
    }

    /**
     * 修改用户观看记录
     *
     * @param ftsUserWatch 用户观看记录
     * @return 结果
     */
    @Override
    public int updateFtsUserWatch(FtsUserWatch ftsUserWatch) {
        return ftsUserWatchMapper.updateById(ftsUserWatch);
    }

    /**
     * 批量删除用户观看记录
     *
     * @param ids 需要删除的用户观看记录主键
     * @return 结果
     */
    @Override
    public int deleteFtsUserWatchByIds(Long[] ids) {
        return ftsUserWatchMapper.deleteFtsUserWatchByIds(ids);
    }

    /**
     * 删除用户观看记录信息
     *
     * @param id 用户观看记录主键
     * @return 结果
     */
    @Override
    public int deleteFtsUserWatchById(Long id) {
        return ftsUserWatchMapper.deleteFtsUserWatchById(id);
    }
}